package com.itheima.service.impl;

import com.itheima.service.UploadService;
import cn.itcast.AliyunOSSOperator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
public class UploadServiceImpl implements UploadService {

    @Autowired
    private AliyunOSSOperator aliyunOSSOperator;

    @Override
    public String upload(MultipartFile file) throws Exception {
        String url = aliyunOSSOperator.upload(file.getBytes(), file.getOriginalFilename());
        return url;

    }
}
